function banner() { //幻灯片部分
  /*获取图片的大小*/
  var oClinWidth1 = $(window).width();
  //图片的个数
  var imgNums = $('.hdpimgwarp>ul>li').length;

  //浏览器的宽
  function widthHeight() {
    var oClinWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
    oClinWidth1 = oClinWidth;
    console.log(oClinWidth);
    //幻灯片高度
    if (oClinWidth < 710) {
      var warpWidth = (oClinWidth * 475) / 720;
    } else {
      var warpWidth = (oClinWidth * 475) / 1920;
    }
    if (warpWidth <= 475) {
      $('.hdpwarp').css({
        "height": warpWidth + "px"
      });
      $('.hdpimgwarp').css({
        "height": warpWidth + "px"
      });
      $('.hdpimgwarp>ul').css({
        "height": warpWidth + "px"
      });
      $('.hdpimgwarp>ul>li').css({
        "height": warpWidth + "px"
      });
    } else {
      $('.hdpwarp').css({
        "height": 475 + "px"
      });
      $('.hdpimgwarp').css({
        "height": 475 + "px"
      });
      $('.hdpimgwarp>ul').css({
        "height": 475 + "px"
      });
      $('.hdpimgwarp>ul>li').css({
        "height": 475 + "px"
      });
    }

    //hdpimgwarp ul的总长度
    $('.hdpimgwarp>ul').css({
      "width": (oClinWidth * imgNums) + "px"
    });
    $('.hdpimgwarp>ul>li').css({
      "width": oClinWidth + "px"
    });
  }
  widthHeight();
  window.onresize = function () {
    widthHeight();
    danimate();
  };
  $('.hdpimgwarp>ul>li:first').addClass('active1');
  danimate = function () {
    var oData = $active.attr('data') - 1;
    $active.addClass('active');
    $('.hdpimgwarp>ul>li').eq(oData).addClass('active1');
    $('.hdpdianwarp span').not($active).removeClass('active');
    $('.hdpimgwarp>ul>li').not($('.hdpimgwarp>ul>li').eq(oData)).removeClass('active1');
    $('.hdpimgwarp>ul').animate({
      "left": -(oData * oClinWidth1) + 'px'
    }, 300);
  };

  function gunDong1() {
    gunDong = setInterval(function () {
      $active = $('.hdpdianwarp span.active').next();
      if ($active.length == 0) {
        $active = $('.hdpdianwarp span:first');
      }
      danimate();
    }, 5000);
  };
  gunDong1();

  /*鼠标放上动画停止*/
  $('.hdpimgwarp').hover(function () {
    clearInterval(gunDong);
  }, function () {
    gunDong1();
  });
  /*鼠标点击小标 */
  $('.hdpdianwarp span').click(function () {
    $active = $(this);
    clearInterval(gunDong);
    danimate();
    gunDong1();

  })
}
banner();
